import 'package:flutter/material.dart';
import 'package:flutter_kit_plus/flutter_kit.dart';
import 'package:get/get.dart';

import '../../generated/my_localizations.dart';
import '../routes/app_pages.dart';

class NavigationService {
  static void navigateToPage(BuildContext context, String title) {
    final localizations = MyLocalizations.of(context)!;
    if (title == localizations.password) {
      Get.offAndToNamed(Routes.PASSWORD);
      // Navigator.popAndPushNamed(context, Routes.PASSWORD);
    } else if (title == localizations.my_devices) {
    } else if (title == localizations.about) {
      Get.offAndToNamed(Routes.ABOUT);
      // Navigator.popAndPushNamed(context, Routes.ABOUT);
    }
    switch (title) {
      case '左边抽屉':
        Scaffold.of(context).openDrawer();
        break;
      case '右边抽屉':
        Scaffold.of(context).openEndDrawer();
        break;
      default:
    }
  }
}
